
import {
    getMesTechList
} from '@/api/process/mesTechnologyCharacteristic'

export const mesTechnologyDialog = {
    data(){
        return {
            mesTechnologyDialogVisible:false,
            getMesTechList,
            hasMesTechFooter:true,
            mesTechSearchDialog:{
                inline: true,
                formDesc: {
                    technologyCode: {
                        type: "input",
                        layout: 8,
                        label: $i18n.t("mesTechnologyCharacteristic.techCode"),
                    },
                    technologyName: {
                        type: "input",
                        layout: 8,
                        label: $i18n.t("mesTechnologyCharacteristic.techName"),
                    },
                }
            },
            mesTechDialogColumn:[
                {
                    type: "selection",
                },
                {
                    type: "index",
                    label: $i18n.t('common.order'),
                    fixed: "left",
                },
                {
                    prop: "technologyCode",
                    label: $i18n.t("mesTechnologyCharacteristic.techCode"),
                    minWidth: 150,
                    showOverflowTooltip: true
                },
                {
                    prop: "technologyName",
                    label:$i18n.t("mesTechnologyCharacteristic.techName"),
                    minWidth: 250,
                    showOverflowTooltip: true
                },
                {
                    prop: "versionNumber",
                    label:$i18n.t("mesTechnologyCharacteristic.version"),
                    minWidth: 100,
                    showOverflowTooltip: true
                },
                {
                    prop: "prodCode",
                    label:$i18n.t("mesTechnologyCharacteristic.prodCode"),
                    minWidth: 150,
                    showOverflowTooltip: true
                },
                {
                    prop: "prodName",
                    label:$i18n.t("mesTechnologyCharacteristic.prodName"),
                    minWidth: 250,
                    showOverflowTooltip: true
                },
                {
                    prop: "seriesCode",
                    label:$i18n.t("mesTechnologyCharacteristic.seriesCode"),
                    minWidth: 150,
                    showOverflowTooltip: true
                },
                {
                    prop: "seriesName",
                    label:$i18n.t("mesTechnologyCharacteristic.seriesName"),
                    minWidth: 250,
                    showOverflowTooltip: true
                },
                {
                    prop: "standardTime",
                    label: $i18n.t("mesTechnologyCharacteristic.standardTime"),
                    minWidth: 100,
                    showOverflowTooltip: true,
                },
                {
                    prop: "assistTime",
                    label: $i18n.t("mesTechnologyCharacteristic.assistTime"),
                    minWidth: 100,
                    showOverflowTooltip: true,
                }
            ]
        }
    },
    methods: {
        // 弹框表格，双击表格，或者点击确定 返回选中数据
        getSelectMesTech(data) {
            // 调试完成记得删除控制台打印
            //console.log("选中数据", data);
            // 这里可以自定义返回字段信息
            // 第一个入参为当前表单绑定的对象，第二个入参为要修改的字段名，第三个入参为选中数据中相应信息
            this.$set(this.formDataDialog, "techCode", data[0].technologyCode);
            this.$set(this.formDataDialog, "techName", data[0].technologyName);
            this.$set(this.formDataDialog, "techVersion", data[0].versionNumber);
            this.$set(this.formDataDialog, "techId", data[0].id);

            this.$set(this.formDataDialog, "seriesCode", data[0].seriesCode);
            this.$set(this.formDataDialog, "seriesName", data[0].seriesName);
            this.$set(this.formDataDialog, "modelCode", data[0].prodCode);
            this.$set(this.formDataDialog, "modelName", data[0].prodName);
        },
    }

}

